Python (programming language)
part 20/106 · 174.3 KB total
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
• Python uses the + operator for string concatenation. The language uses the * operator for duplicating a string a specified number of times.
• The @ infix operator is intended to be used by libraries such as NumPy for matrix multiplication.cite-ref-pep465-92-0[89]cite-ref-python3-5changelog-93-0[90]
• The syntax :=, called the "walrus operator", was introduced in Python 3.8. This operator assigns values to variables as part of a larger expression.cite-ref-python3-8changelog-94-0[91]
• In Python, == compares two objects by value. Python's is operator may be used to compare object identities (i.e., comparison by reference), and comparisons may be chained—for example, a <= b <= c.
• Python uses and, or, and not as Boolean operators.
• Python has a type of expression called a list comprehension, and a more general expression called a generator expression.cite-ref-autont-59-65-1[63]
• Anonymous functions are implemented using lambda expressions; however, there may be only one expression in each body.
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────